home *** CD-ROM | disk | FTP | other *** search
- # Source Generated with Decompyle++
- # File: in.pyc (Python 2.6)
-
- import gtk
- from pango import SCALE
-
- def set_autowrap(widget):
- if isinstance(widget, gtk.Container):
- children = widget.get_children()
- for i in xrange(len(children)):
- set_autowrap(children[i])
-
- elif isinstance(widget, gtk.Label) and widget.get_line_wrap():
- widget.connect_after('size-allocate', label_size_allocate)
-
-
-
- def label_size_allocate(widget, allocation):
- layout = widget.get_layout()
- (lw_old, lh_old) = layout.get_size()
- if lw_old / SCALE == allocation.width:
- return None
- layout.set_width(allocation.width * SCALE)
- (lw, lh) = layout.get_size()
- if lh_old != lh:
- widget.set_size_request(-1, lh / SCALE)
-
-
-